<?php
/**
 * ------------------------------------------------------------------------
 * JA Disqus Debate Echo plugin for Joomla 1.7.x
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
?>
<?php

if (count($this->_commentsID) && count($this->_comments)) :
    ?>
<div style="display: none;">
<?php
    echo implode("\n\n", $this->_comments);
    ?>
</div>
<script type="text/javascript">
/* <![CDATA[ */
window.addEvent('domready', function(){
	ids = [<?php
    echo "'" . implode("','", $this->_commentsID) . "'";
    ?>];
	
	ids.each (function(id) {
		holder = $('JaCommentPlaceHolder'+id);
		comment = $('JaCommentContainer'+id);
		if ($chk(holder) && $chk(comment)) {
			//holder.replaceWith(comment.remove());
			comment.dispose().replaces(holder);
		}
	});
	
});
/* ]]> */
</script>

<?php endif;
?>